package cn.hollis.nft.turbo.collection.configuration;

import cn.hollis.nft.turbo.api.chain.service.ChainFacadeService;
import cn.hollis.nft.turbo.api.order.service.OrderFacadeService;
import cn.hollis.nft.turbo.api.user.service.UserFacadeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RpcSpringAutowired {
  @DubboReference(version = "1.0.0")
  private OrderFacadeService orderFacadeService;

  @DubboReference(version = "1.0.0")
  private ChainFacadeService chainFacadeService;

  @DubboReference(version = "1.0.0")
  private UserFacadeService userFacadeService;

  @Bean
  @ConditionalOnMissingBean(name = "orderFacadeService")
  public OrderFacadeService orderFacadeService() {
    return orderFacadeService;
  }


  @Bean
  @ConditionalOnMissingBean(name = "chainFacadeService")
  public ChainFacadeService chainFacadeService() {
    return chainFacadeService;
  }


  @Bean
  @ConditionalOnMissingBean(name = "userFacadeService")
  public UserFacadeService userFacadeService() {
    return userFacadeService;
  }

}
